package com.run_java_test.t.test_code;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.stereotype.Component;

/**
 * 检查获取springmvc的所有映射路径
 */
@Component
public class ControllerMappingChecker {

    @Autowired
    private RequestMappingHandlerMapping requestMappingHandlerMapping;

    public void checkControllerMappings() {
        requestMappingHandlerMapping.getHandlerMethods().forEach((key, value) -> {
            System.out.println("Mapping: " + key + " -> " + value);
        });
    }
}
